#ifndef LEARNER_H
#define LEARNER_H
#include <vector>
#include "teacher.h"
#include "cdnf.h"
namespace cdnf{

struct unit{
	Valuation a;
	DNF dnf;
	std::vector<Valuation> S;
};
class Learner{
public:
	Learner(Teacher* teacher, int numberOfVar);
	CDNF& learn();
	void learnCDNF();
	void restart();
	CDNF& getCandidate();
	void addUnit(Valuation& counterExample);
	CDNF candidate;
private:
	Teacher* teacher;
	
	int numberOfVar;
	std::vector<unit> units;
	int t;
	void constructDNFs();
	Valuation walkTowardsA(Valuation& u, Valuation& a);
	void learnByPartial(std::vector<int> terms);
};
}
#endif
